home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
PROGRAM
/
PCW_C.ARJ
/
WNDDEMO.C
< prev
next >
Wrap
Text File
|
1990-01-30
|
870b
|
36 lines
#include <stdio.h>
#include <time.h>
#include "pcwproto.h"
#define rnd(x) (rand() % (x))
void main(void) {
WNDPTR *wnd;
time_t timer;
int tl, bl, wr, wc, lcv, ch;
int mxr, mxc;
static char *msg[] = {
"Welcome to C",
"The Powerful Language",
"for",
"Major Applications Software",
NULL
};
/* Create a box with a advertisment for the C language */
get_cursor_size(&tl,&bl); set_cursor_size(0,0);
chk_video_state(&mxr,&mxc);
bordercolor(YELLOW,BLUE);
wnd = wframe(7,19,15,60,LIGHTGRAY,BLUE);
q_block_write(9,CENTER,LIGHTGRAY,BLUE,msg);
time(&timer); srand(timer); ch = keywait(3);
for (lcv = 0; lcv < 10 && ch != 27; lcv++) {
wr = rnd(mxr)+1; wc = rnd(mxc)+1;
wndmove(wnd,wr,wc);
ch = keywait(3);
}
wpop(wnd); set_cursor_size(tl,bl);
}